//
//  ListViewController.h
//  We365
//
//  Created by Pham Khuong Duy on 12/14/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "Category.h"

enum requestTypes
{
    isGettingItems,
    isGettingDistances,
    isGettingDetail
};

@interface ListViewController : UIViewController <UITableViewDataSource, UITableViewDelegate, UISearchBarDelegate, UIAlertViewDelegate>
{    
    UIAlertView *alert;
    UITableView *table;
    NSMutableArray *allListItem;
    NSMutableArray *listItem;
    Category *category;
    NSString *searchKey;   
    NSMutableData *webData;
    UISearchBar *search;
    NSURLConnection *conn;    
}
@property (nonatomic, retain) UIAlertView *alert;
@property (nonatomic, retain) IBOutlet UITableView *table;
@property (nonatomic, retain) NSMutableArray *allListItem;
@property (nonatomic, retain) NSMutableArray *listItem;
@property (nonatomic, retain) Category *category;
@property (nonatomic, retain) NSString *searchKey;
@property (nonatomic, retain) NSMutableData *webData;
@property (nonatomic, retain) IBOutlet UISearchBar *search;
@property (nonatomic, retain) NSURLConnection *conn;

- (id)initWithCategory:(Category *)c andKey:(NSString *)k;
- (void)getAllItems;
- (void)getDistances;
- (void)resetSearch;
- (void)handleSearch:(NSString *)key;
@end
